
const directive = {
  install (Vue) {
    Vue.directive('fofo', {
      inserted (el) {
        if (el.nodeName === 'TEXTAREA' || el.nodeName === 'INPUT') {
          el.focus()
        } else {
          const inp = el.querySelector('input')
          const texA = el.querySelector('textarea')
          if (inp) {
            inp.focus()
          }
          if (texA) {
            texA.focus()
          }
        }
      }
    })
  }
}
export default directive
